package cn.com.yusys.yusp.admin.web.rest;

import cn.com.yusys.yusp.admin.service.RoleProviderService;
import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.commons.web.rest.dto.ResultDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/provider")
public class RoleProviderServiceResource {
 
    @Autowired
    private RoleProviderService roleProviderService;

    @PostMapping("/findRoles")
    public List<Map<String,Object>> findRolesByOrgIds(QueryModel model) {
    	return roleProviderService.findRolesByOrgIds(model);
    }

    @GetMapping("/findrolelist")
    public ResultDto<List<Map<String,Object>>> findRoles(QueryModel model) {
        List<Map<String,Object>> list = roleProviderService.findRolesByOrgIds(model);
        return new ResultDto<List<Map<String,Object>>>(list);
    }

}
